<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../style.css" type="text/css" media="screen">
<link rel="stylesheet" href="../../print.css" type="text/css" media="print">
<meta content="NumberBase,mx.formatters.NumberBase,decimalSeparatorFrom,decimalSeparatorTo,isValid,thousandsSeparatorFrom,thousandsSeparatorTo,formatDecimal,formatNegative,formatPrecision,formatRounding,formatRoundingWithPrecision,formatThousands,parseNumberString" name="keywords">
<title>mx.formatters.NumberBase</title>
</head>
<body>
<script type="text/javascript" language="javascript" src="../../asdoc.js"></script><script type="text/javascript" language="javascript" src="../../cookies.js"></script><script type="text/javascript" language="javascript">
<!--
				asdocTitle = 'NumberBase - Zentrum virtUOS: virtPresenter';
				var baseRef = '../../';
				window.onload = configPage;
			--></script>
<table style="display:none" id="titleTable" cellspacing="0" cellpadding="0" class="titleTable">
<tr>
<td align="left" class="titleTableTitle">virtPresenter AsDoc</td><td align="right" class="titleTableTopNav"><a onclick="loadClassListFrame('../../all-classes.html')" href="../../package-summary.html">All&nbsp;Packages</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../all-classes.html')" href="../../class-summary.html">All&nbsp;Classes</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../index-list.html')" href="../../all-index-A.html">Index</a>&nbsp;|&nbsp;<a href="../../index.html?mx/formatters/NumberBase.html&amp;mx/formatters/class-list.html" id="framesLink1">Frames</a><a onclick="parent.location=document.location" href="" style="display:none" id="noFramesLink1">No&nbsp;Frames</a></td><td rowspan="3" align="right" class="titleTableLogo"><img alt="Adobe Logo" title="Adobe Logo" class="logoImage" src="../../images/logo.jpg"></td>
</tr>
<tr class="titleTableRow2">
<td align="left" id="subTitle" class="titleTableSubTitle">Class&nbsp;NumberBase</td><td align="right" id="subNav" class="titleTableSubNav"><a href="#propertySummary">Properties</a>&nbsp;| <a href="#methodSummary">Methods</a></td>
</tr>
<tr class="titleTableRow3">
<td colspan="2">&nbsp;</td>
</tr>
</table>
<script type="text/javascript" language="javascript">
<!--
if (!isEclipse() || window.name != ECLIPSE_FRAME_NAME) {titleBar_setSubTitle("Class NumberBase"); titleBar_setSubNav(false,true,false,false,false,false,true,false,false,false,false,false,false,false);}
--></script>
<div class="MainContent">
<table cellspacing="0" cellpadding="0" class="classHeaderTable">
<tr>
<td class="classHeaderTableLabel">Package</td><td><a onclick="javascript:loadClassListFrame('class-list.html')" href="package-detail.html">mx.formatters</a></td>
</tr>
<tr>
<td class="classHeaderTableLabel">Class</td><td class="classSignature">public class NumberBase</td>
</tr>
</table>
<p></p>
  The NumberBase class is a utility class that contains
  general number formatting capabilities, including rounding,
  precision, thousands formatting, and negative sign formatting.
  The implementation of the formatter classes use this class.
   <p></p>
<p>
<span class="classHeaderTableLabel">See also</span>
</p>
<div class="seeAlso">
<a href="../formatters/NumberFormatter.html" target="">mx.formatters.NumberFormatter</a>
<br>
<a href="../formatters/NumberBaseRoundType.html" target="">mx.formatters.NumberBaseRoundType</a>
</div>
<br>
<hr>
</div>
<a name="propertySummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Public Properties</div>
<table id="summaryTableProperty" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Property</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#decimalSeparatorFrom">decimalSeparatorFrom</a> : String<div class="summaryTableDescription">
      Decimal separator character to use
   when parsing an input String.</div>
</td><td class="summaryTableOwnerCol">NumberBase</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#decimalSeparatorTo">decimalSeparatorTo</a> : String<div class="summaryTableDescription">
      Decimal separator character to use
   when outputting formatted decimal numbers.</div>
</td><td class="summaryTableOwnerCol">NumberBase</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#isValid">isValid</a> : Boolean = false<div class="summaryTableDescription">
   If <code>true</code>, the format succeeded,
   otherwise it is <code>false</code>.</div>
</td><td class="summaryTableOwnerCol">NumberBase</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#thousandsSeparatorFrom">thousandsSeparatorFrom</a> : String<div class="summaryTableDescription">
      Character to use as the thousands separator
   in the input String.</div>
</td><td class="summaryTableOwnerCol">NumberBase</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#thousandsSeparatorTo">thousandsSeparatorTo</a> : String<div class="summaryTableDescription">
      Character to use as the thousands separator
   in the output String.</div>
</td><td class="summaryTableOwnerCol">NumberBase</td>
</tr>
</table>
</div>
<a name="methodSummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Public Methods</div>
<table id="summaryTableMethod" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Method</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#NumberBase()">NumberBase</a>(decimalSeparatorFrom:String = ".", thousandsSeparatorFrom:String = ",", decimalSeparatorTo:String = ".", thousandsSeparatorTo:String = ",")</div>
<div class="summaryTableDescription">
   Constructor.</div>
</td><td class="summaryTableOwnerCol">NumberBase</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#formatDecimal()">formatDecimal</a>(value:String):String</div>
<div class="summaryTableDescription">
   Formats a number by replacing the default decimal separator, ".", 
   with the decimal separator specified by <code>decimalSeparatorTo</code>.</div>
</td><td class="summaryTableOwnerCol">NumberBase</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#formatNegative()">formatNegative</a>(value:String, useSign:Boolean):String</div>
<div class="summaryTableDescription">
   Formats a negative number with either a minus sign (-)
   or parentheses ().</div>
</td><td class="summaryTableOwnerCol">NumberBase</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#formatPrecision()">formatPrecision</a>(value:String, precision:int):String</div>
<div class="summaryTableDescription">
   Formats a number by setting its decimal precision by using 
   the <code>decimalSeparatorTo</code> property as the decimal separator.</div>
</td><td class="summaryTableOwnerCol">NumberBase</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#formatRounding()">formatRounding</a>(value:String, roundType:String):String</div>
<div class="summaryTableDescription">
   Formats a number by rounding it.</div>
</td><td class="summaryTableOwnerCol">NumberBase</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#formatRoundingWithPrecision()">formatRoundingWithPrecision</a>(value:String, roundType:String, precision:int):String</div>
<div class="summaryTableDescription">
   Formats a number by rounding it and setting the decimal precision.</div>
</td><td class="summaryTableOwnerCol">NumberBase</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#formatThousands()">formatThousands</a>(value:String):String</div>
<div class="summaryTableDescription">
   Formats a number by using 
   the <code>thousandsSeparatorTo</code> property as the thousands separator 
   and the <code>decimalSeparatorTo</code> property as the decimal separator.</div>
</td><td class="summaryTableOwnerCol">NumberBase</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#parseNumberString()">parseNumberString</a>(str:String):String</div>
<div class="summaryTableDescription">
   Extracts a number from a formatted String.</div>
</td><td class="summaryTableOwnerCol">NumberBase</td>
</tr>
</table>
</div>
<script type="text/javascript" language="javascript">
<!--
showHideInherited();
--></script>
<div class="MainContent">
<a name="propertyDetail"></a>
<div class="detailSectionHeader">Property detail</div>
<a name="decimalSeparatorFrom"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">decimalSeparatorFrom</td><td class="detailHeaderType">property</td>
</tr>
</table>
<div class="detailBody">
<code>public var decimalSeparatorFrom:String</code><p>
      Decimal separator character to use
   when parsing an input String.
   
   </p><p>The default value is <code>"."</code>.</p>
</div>
<a name="decimalSeparatorTo"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">decimalSeparatorTo</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public var decimalSeparatorTo:String</code><p>
      Decimal separator character to use
   when outputting formatted decimal numbers.
   
   </p><p>The default value is <code>"."</code>.</p>
</div>
<a name="isValid"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">isValid</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public var isValid:Boolean = false</code><p>
   If <code>true</code>, the format succeeded,
   otherwise it is <code>false</code>.
  </p></div>
<a name="thousandsSeparatorFrom"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">thousandsSeparatorFrom</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public var thousandsSeparatorFrom:String</code><p>
      Character to use as the thousands separator
   in the input String.
   
   </p><p>The default value is <code>","</code>.</p>
</div>
<a name="thousandsSeparatorTo"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">thousandsSeparatorTo</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public var thousandsSeparatorTo:String</code><p>
      Character to use as the thousands separator
   in the output String.
   
   </p><p>The default value is <code>","</code>.</p>
</div>
<a name="constructorDetail"></a>
<div class="detailSectionHeader">Constructor detail</div>
<a name="NumberBase()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">NumberBase</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">constructor</td>
</tr>
</table>
<div class="detailBody">
<code>public function NumberBase(decimalSeparatorFrom:String = ".", thousandsSeparatorFrom:String = ",", decimalSeparatorTo:String = ".", thousandsSeparatorTo:String = ",")</code><p>
   Constructor.
  
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">decimalSeparatorFrom</span>:String</code> (default = "<code>.</code>")<code></code> &mdash; Decimal separator to use
   when parsing an input String.
     </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">thousandsSeparatorFrom</span>:String</code> (default = "<code>,</code>")<code></code> &mdash; Character to use
   as the thousands separator in the input String.
     </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">decimalSeparatorTo</span>:String</code> (default = "<code>.</code>")<code></code> &mdash; Decimal separator character to use
   when outputting formatted decimal numbers.
     </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">thousandsSeparatorTo</span>:String</code> (default = "<code>,</code>")<code></code> &mdash; Character to use
   as the thousands separator in the output String.
  </td>
</tr>
</table>
</div>
<a name="methodDetail"></a>
<div class="detailSectionHeader">Method detail</div>
<a name="formatDecimal()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">formatDecimal</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td>
</tr>
</table>
<div class="detailBody">
<code>public function formatDecimal(value:String):String</code><p>
   Formats a number by replacing the default decimal separator, ".", 
   with the decimal separator specified by <code>decimalSeparatorTo</code>. 
     </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">value</span>:String</code> &mdash; The String value of the Number
   (formatted American style ####.##).
     </td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>String</code> &mdash; String representation of the input where "." is replaced
   with the decimal formatting character.
  </td>
</tr>
</table>
</div>
<a name="formatNegative()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">formatNegative</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function formatNegative(value:String, useSign:Boolean):String</code><p>
   Formats a negative number with either a minus sign (-)
   or parentheses ().
     </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">value</span>:String</code> &mdash; Value to be formatted.
     </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">useSign</span>:Boolean</code> &mdash; If <code>true</code>, use a minus sign (-).
   If <code>false</code>, use parentheses ().
     </td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>String</code> &mdash; Formatted number.
  </td>
</tr>
</table>
</div>
<a name="formatPrecision()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">formatPrecision</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function formatPrecision(value:String, precision:int):String</code><p>
   Formats a number by setting its decimal precision by using 
   the <code>decimalSeparatorTo</code> property as the decimal separator.
     </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">value</span>:String</code> &mdash; Value to be formatted.
     </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">precision</span>:int</code> &mdash; Number of decimal points to use.
     </td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>String</code> &mdash; Formatted number.
  </td>
</tr>
</table>
</div>
<a name="formatRounding()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">formatRounding</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function formatRounding(value:String, roundType:String):String</code><p>
   Formats a number by rounding it. 
   The possible rounding types are defined by
   mx.formatters.NumberBaseRoundType.
     </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">value</span>:String</code> &mdash; Value to be rounded.
     </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">roundType</span>:String</code> &mdash; The type of rounding to perform:
   NumberBaseRoundType.NONE, NumberBaseRoundType.UP,
   NumberBaseRoundType.DOWN, or NumberBaseRoundType.NEAREST.
     </td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>String</code> &mdash; Formatted number.
     </td>
</tr>
</table>
<p>
<span class="label">See also</span>
</p>
<div class="seeAlso">
<a href="../formatters/NumberBaseRoundType.html" target="">mx.formatters.NumberBaseRoundType</a>
</div>
</div>
<a name="formatRoundingWithPrecision()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">formatRoundingWithPrecision</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function formatRoundingWithPrecision(value:String, roundType:String, precision:int):String</code><p>
   Formats a number by rounding it and setting the decimal precision.
   The possible rounding types are defined by
   mx.formatters.NumberBaseRoundType.
     </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">value</span>:String</code> &mdash; Value to be rounded.
     </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">roundType</span>:String</code> &mdash; The type of rounding to perform:
   NumberBaseRoundType.NONE, NumberBaseRoundType.UP,
   NumberBaseRoundType.DOWN, or NumberBaseRoundType.NEAREST.
     </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">precision</span>:int</code> &mdash; int of decimal places to use.
     </td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>String</code> &mdash; Formatted number.
     </td>
</tr>
</table>
<p>
<span class="label">See also</span>
</p>
<div class="seeAlso">
<a href="../formatters/NumberBaseRoundType.html" target="">mx.formatters.NumberBaseRoundType</a>
</div>
</div>
<a name="formatThousands()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">formatThousands</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function formatThousands(value:String):String</code><p>
   Formats a number by using 
   the <code>thousandsSeparatorTo</code> property as the thousands separator 
   and the <code>decimalSeparatorTo</code> property as the decimal separator.
     </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">value</span>:String</code> &mdash; Value to be formatted.
     </td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>String</code> &mdash; Formatted number.
  </td>
</tr>
</table>
</div>
<a name="parseNumberString()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">parseNumberString</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function parseNumberString(str:String):String</code><p>
   Extracts a number from a formatted String.
   Examines the String from left to right
   and returns the first number sequence.
   Ignores thousands separators and includes the
   decimal and numbers trailing the decimal.
     </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">str</span>:String</code> &mdash; String to parse for the numeric value.
     </td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>String</code> &mdash; Value, which can be a decimal.
  </td>
</tr>
</table>
</div>
<br>
<br>
<hr>
<br>
<p></p>
<center class="copyright"> 
</center>
</div>
</body>
</html>
<!-- -->
